package xio.ccf_201703;

import java.util.Scanner;

/**
 * 201703-1 分蛋糕 100分
 * Created by Xio on 2017/10/31 0031.
 */
public class Cake {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int result = 0;
        int cakeWeight = 0;
        for (int i = 0; i < n; i++) {
            int tmp = sc.nextInt();
            if (cakeWeight == 0){
                result++;
            }
            cakeWeight+=tmp;
            if (cakeWeight >= k){
                cakeWeight = 0;
            }
        }
        System.out.println(result+"");
    }
}
